package com.cxh.service.impl;

import com.cxh.base.Data1ServiceImpl;
import com.cxh.util.DataSource;
import com.cxh.dao.SysVarsDao;
import com.cxh.entity.SysVars;
import com.cxh.service.SysVarsService;
import com.shimne.util.ObjectUtil;
import com.shimne.util.StringUtil;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 类说明：
 * @author  ChenXH
 * @date  2019-01-04 15:22:57
 */
@Service("sysVarsService")
@DataSource("dataSource1")
public class SysVarsServiceImpl extends Data1ServiceImpl<SysVars> implements SysVarsService {
	@Autowired
	private SysVarsDao sysVarsDao;
	
	public SysVars findByName(String name) {
		if(StringUtil.isTrimEmpty(name)){
			return null;
		}
		
		return sysVarsDao.loadByName(name);
	}

	public String loadUrlByName(String name) {
		if(StringUtil.isTrimEmpty(name)){
			return null;
		}
		SysVars sysVars=sysVarsDao.loadByName(name);
		return ObjectUtil.isNull(sysVars)?"":sysVars.getValues();
	}
    

}
